<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let arr = [{name:'j1',type:'0'},{name:'j2',type:'1'},{name:'j3',type:'1'},{name:'j4',type:'0'},]
        // let b = arr.filter(val=>{
        //     return val.type==='0'
        // })
        // let c = arr.filter(val=>{
        //     return val.type==='1'
        // })
        // console.log(b,c);
       function lei(bl){
        let c = arr.filter(val=>{
            return val.type===bl
        })
        console.log(c);
       }
       console.log(lei('1'),lei('0'));
    </script>
</body>
</html>